package com.fly.push.flux.hight;

import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class SinksProduceDataTask
{
    @Autowired
    SinksSsePublisherService ssePublisherService;
    
    @Scheduled(cron = "0/10 * * * * ?")
    public void run()
    {
        String now = DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss");
        ssePublisherService.publishMessage(now);
    }
}